#ifndef ProtocolHandler_h
#define ProtocolHandler_h

#include <Arduino.h>

class ProtocolHandler {
  public:
        ProtocolHandler();
       // ~ProtocolHandler();
        void sendAck();
        void sendNack();
        boolean handleRequest(String inputString);
        void sendResponse(String response);
        float getTemp(int AnalogInputNumber,int OutputUnit,float B,float T0,float R0,float R_Balance);
        float getTempWTable(int AnalogInputNumber, float R_Balance);
        String ConvertFloatToString(float val, int val_size, int val_before_precision, int val_after_precision);
        double voltage2g(double accAnalogValue);

        void setMinT(boolean b4reset, float val);
		float getMinT(boolean b4reset);

		void setMaxT(boolean b4reset, float val);
		float getMaxT(boolean b4reset);

		void setAccelXMin(boolean b4reset,double val);
		double getAccelXMin(boolean b4reset);

		void setAccelYMin(boolean b4reset, double val);
		double getAccelYMin(boolean b4reset);

		void setAccelZMin(boolean b4reset, double val);
		double getAccelZMin(boolean b4reset);

		void setAccelXMax(boolean b4reset, double val);
		double getAccelXMax(boolean b4reset);

		void setAccelYMax(boolean b4reset, double val);
		double getAccelYMax(boolean b4reset);

		void setAccelZMax(boolean b4reset, double val);
		double getAccelZMax(boolean b4reset);

		void setDToverdtMax(boolean b4reset, double val);
		double getDToverdfMax(boolean b4reset);

		void setMinMaxValues();

		void setAutoT_Trans_Sec(boolean b4reset, double val);
		double getAutoT_Trans_Sec(boolean b4reset);
		void setAutoT_Degrees_Changed(boolean b4reset, double val);
		double getAutoT_Degrees_Changed(boolean b4reset);
		char * floatToString(char * outstr, float value, int places, int minwidth=0, bool rightjustify=false);
		float convertStrToFloat(String s);

		void setminT_b4_reset(float val);
		float getminT_b4_reset();
		void setmaxT_b4_reset(float val);
		float getmaxT_b4_reset();
		void setaccelXMin_b4_reset(float val);
		float getaccelXMin_b4_reset();
		void setaccelXMax_b4_reset(float val);
		float getaccelXMax_b4_reset();
		void setaccelYMin_b4_reset(float val);
		float getaccelYMin_b4_reset();
		void setaccelYMax_b4_reset(float val);
		float getaccelYMax_b4_reset();
		void setaccelZMin_b4_reset(float val);
		float getaccelZMin_b4_reset();
		void setaccelZMax_b4_reset(float val);
		float getaccelZMax_b4_reset();
		void setdToverdtMax_b4_reset(float val);
		float getdToverdtMax_b4_reset();
};

#endif